package com.epam.zhilko.entity;

import javax.persistence.*;
import java.util.ArrayList;
import java.util.Collection;

/**
 * Created with IntelliJ IDEA.
 * User: admin
 * Date: 11/26/13
 * Time: 2:12 PM
 * To change this template use File | Settings | File Templates.
 */
@Entity(name = "PROJ")
public class Project {


    private int id;
    private String name;
    private Collection<Employee> employees = new ArrayList<Employee>();

    @ManyToMany(mappedBy = "projects", cascade = CascadeType.PERSIST)
    public Collection<Employee> getEmployees() {
        return employees;
    }

    public void setEmployees(Collection<Employee> employees) {
        this.employees = employees;
    }

    @Column(name = "PROJ_NAME")
    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "PROJ_ID")
    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }


}
